package com.gupaoedu.demo.serialize;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;

/**
 * <p>
 *
 * </p>
 *
 * @author Nicky
 * @since 2019-07-20
 */
public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("localhost",8080);

        User user = new User();
        user.setName("nicky");
        user.setAge(18);

        ObjectOutputStream objectOutputStream = new ObjectOutputStream(socket.getOutputStream());
        objectOutputStream.writeObject(user);

        socket.close();

    }
}
